package leetcode.violence;

public class Money {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        System.out.println(process(2934, 0, arr));
    }

    public static int process(int n, int k, int[] arr) {
        if (arr.length == k) {
            return n == 0 ? 1 : 0;
        }
        if (n == 0) {
            return 1;
        }
        int num = 0;
        for (int i = 0; i * arr[k] <= n; i++) {
            num += process(n - i * arr[k], k + 1, arr);
        }
        return num;
    }
}
